
/* pixsys.c by bill buckels 1991 */
/* extracts an embedded image from a prodos sys program with an embedded graphic */


#include <malloc.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <io.h>
#include <fcntl.h>

main(int argc, char *argv[])
{
    FILE *fp, *fp2;
    char buf[66],buf2[66];
    int i;

    if(argc==2)
    {
    sprintf(buf,"%s.SYS",argv[1]);
    sprintf(buf2,"%s.BIN",argv[1]);

    fp = fopen(buf,"rb");
    fp2 = fopen(buf2,"wb");

    for (i=0;i<0x2000;i++)fgetc(fp);
    for (i=0;i<0x2000;i++)fputc(fgetc(fp),fp2);

    fclose(fp);
    fclose(fp2);

    }

    exit(0);
}

